package framework.util.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import framework.util._PropertyUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.Properties;
import java.util.UUID;

/**
 * 用于跳转页面
 *
 * @author 吴宇亮
 * @date 2018年12月19日
 */
@RequestMapping("/Url.do")
@Controller
public class UrlController {

	@RequestMapping(params = "method=toPage")
	public ModelAndView toPage(ModelAndView model, HttpServletRequest request, HttpServletResponse response) {
		String uuid = UUID.randomUUID().toString();
		model.addObject("uuid", uuid);

		String url = request.getParameter("url");
		model.setViewName(url);
		return model;
	}

	@RequestMapping(params = "method=getJs")
	public ModelAndView getJs(ModelAndView model, HttpServletRequest request, HttpServletResponse response) {
		String url = request.getParameter("url");
		model.setViewName(url);
		return model;
	}

}
